package server;


import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) throws IOException {
        //简易版服务器，读取一下真正浏览器发来的请求(原生的服务器)
        /*ServerSocket server = new ServerSocket(9999);
        Socket socket = server.accept();
        BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        String value = reader.readLine();
        while (value != null && "" != value){
            System.out.println(value);
            value = reader.readLine();
        }*/
        //自己写的
        ServerSocket server = new ServerSocket(9999);
        while (true){
            //等待浏览器链接
            Socket socket = server.accept();
            //启动服务器线程处理
            Handler handler = new Handler(socket);
            handler.start();
        }

    }
}
